import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'
import ProblemsView from '../views/ProblemsView.vue'
import ProblemDetailView from '../views/ProblemDetailView.vue'
import ContestsView from '../views/ContestsView.vue'
import ContestDetailView from '../views/ContestDetailView.vue'
import RankingsView from '../views/RankingsView.vue'
import SubmissionsView from '../views/SubmissionsView.vue'
import ProfileView from '../views/ProfileView.vue'
import LoginView from '../views/LoginView.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView
  },
  {
    path:'/login',
    name:'LoginView',
    component:LoginView
  },
  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  },
  {
    path: '/problems',
    name: 'Problems',
    component: ProblemsView
  },
  {
    path: '/problems/:id',
    name: 'ProblemDetail',
    component: ProblemDetailView
  },
  {
    path: '/contests',
    name: 'Contests',
    component: ContestsView
  },
  {
    path: '/contests/:id',
    name: 'ContestDetail',
    component: ContestDetailView
  },
  {
    path: '/rankings',
    name: 'Rankings',
    component: RankingsView
  },
  {
    path: '/submissions',
    name: 'Submissions',
    component: SubmissionsView
  },
  {
    path: '/evaluate',
    name: 'Evaluate',
    component: () => import('../views/SubmissionsView.vue')
  },
  {
    path: '/profile',
    name: 'Profile',
    component: ProfileView
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
